Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms

Public Class FrmCrKiemke_kho_lo
    Private data As DataTable
    Private thang, nam, kho As String
    Private tiendauky As Double
    Private customerReport As ReportDocument

    Delegate Sub WaitDelegate()

    Private Sub FrmCrKiemke_kho_lo_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        globalVariale.runWaitting = True
        Dim wd As New WaitDelegate(AddressOf moduleWaitting.runningWait)
        wd.BeginInvoke(Nothing, Nothing)

        Dim sqlQuery As String = "SELECT * FROM tbl_dot_kiemke_kho_lo where recycleId='" & nam & thang & "'  AND (ton_sosach<>0 OR ton_thucte<>0 OR thua<>0 OR thieu<>0 ) ORDER BY ma_hanghoa "
        Dim reportPath = Application.StartupPath & "\" & "crKiemke_kho_lo.rpt"
        customerReport = New ReportDocument()
        customerReport.Load(reportPath)
        customerReport.SetDataSource(moduleReportConfig.GetDataTable(sqlQuery))
        customerReport.SetParameterValue("month", thang)
        customerReport.SetParameterValue("year", nam)
        customerReport.SetParameterValue("TKho", kho)
        customerReport.SetParameterValue("company", globalVariale.COMPANY)
        customerReport.SetParameterValue("address", globalVariale.ADDRESS)
        Me.CrNXTTongHopview.ReportSource = customerReport

        globalVariale.runWaitting = False
    End Sub

    Private Sub BtnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Close()
    End Sub
    Public Sub setThang(ByVal s As String)
        thang = s
    End Sub

    Public Sub setNam(ByVal s As String)
        nam = s
    End Sub
    Public Sub setKho(ByVal s As String)
        kho = s
    End Sub

    Public Sub setData(ByVal d As DataTable)
        data = d
    End Sub


End Class
